package cn.kgc.controller;

import cn.kgc.pojo.Jobposting;
import cn.kgc.service.JobpostingService;
import cn.kgc.util.PageData;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;


@RestController
public class JobpostingController {
    @Reference
    private JobpostingService jobpostingService;

    @RequestMapping("/findAll.json")
    public List<Jobposting> findAll(){
        return jobpostingService.findAll();
    }

    @RequestMapping("/queryByPosition.json")
    private PageData queryByPosition(String position, Integer pageIndex, Integer size){
        return jobpostingService.queryByPosition(position,pageIndex,size);
    }
    @RequestMapping("/queryByCategory.json")
    private PageData queryByCategory(String category, Integer pageIndex2, Integer size2){
        return jobpostingService.queryByCategory(category,pageIndex2,size2);
    }

    @RequestMapping("/getJobpostingByPosition.json")
    public List<Jobposting> getJobpostingByPosition(String position){
        return jobpostingService.getJobpostingByPosition(position);
    }

    @RequestMapping("/getAllJobposting.json")
    public List<Jobposting> getAllJobposting(){
        return jobpostingService.getAllJobposting();
    }

    @RequestMapping("/findById.json")
    public Jobposting findById(Integer resumeId){
        return (Jobposting) jobpostingService.findById(resumeId);
    }




}
